home *** CD-ROM | disk | FTP | other *** search
/ Champak 120 / Vol 120.iso / games / battlefi.swf / scripts / frame_638 / PlaceObject2_402_33 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Text File  |  2010-11-09  |  1KB  |  53 lines

  1. onClipEvent(enterFrame){
  2.    if(_root.vic)
  3.    {
  4.       this._y = 491.2;
  5.    }
  6.    if(!this.hitTest(_root.castle))
  7.    {
  8.       this._x += speed;
  9.    }
  10.    if(duped && _root.population < _root.poptot)
  11.    {
  12.       _root.population = _root.population + 1;
  13.       _root.gold -= 500;
  14.       i++;
  15.       duplicateMovieClip(_root.cav,"cav" + i,16384 + (300 + i));
  16.       _root["cav" + i]._x = -6.399999999999999;
  17.       _root["cav" + i]._y = random(50) + 251.7;
  18.       duped = false;
  19.    }
  20.    if(this.hitTest(_root.castle) && !attkin)
  21.    {
  22.       this.gotoAndPlay("attk");
  23.       attkin = true;
  24.    }
  25.    if(this.dead && this._currentframe < 13)
  26.    {
  27.       this.gotoAndPlay("die");
  28.    }
  29.    l = _root.lvl;
  30.    while(l < _root.lvl + 0.1)
  31.    {
  32.       if(this.hit.hitTest(_root["a" + l]))
  33.       {
  34.          this.gotoAndPlay("die");
  35.          _root["a" + l].removeMovieClip();
  36.       }
  37.       l++;
  38.    }
  39.    if(this.hit.hitTest(_root.castle["th" + _root.castle.thing.i]))
  40.    {
  41.       this.gotoAndPlay("die");
  42.       _root.castle["th" + _root.castle.thing.i].removeMovieClip();
  43.    }
  44.    if(this.dead)
  45.    {
  46.       this._x -= speed;
  47.    }
  48.    if(this.deadfull)
  49.    {
  50.       this._x = -1000000000;
  51.    }
  52. }
  53.